package com.whisper.utils;

import java.io.InputStream;
import java.io.UnsupportedEncodingException;

/**
 * TODO 类描述
 *
 * @author ysz
 * @date 2024/2/28 17:18
 */
public class CommonUtils {
    public static InputStream readResourceFile(String fileName) {
        return CommonUtils.class.getClassLoader().getResourceAsStream(fileName);
    }

    public static String getUTF8String(String str) {
        try {
            return new String(str.getBytes("UTF-8"), "UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return null;
    }
}
